#ifndef __Key_H
#define __Key_H

#include "stm32f1xx_hal.h"



enum Direction
{
	UP = 1,
	DOWN,
	LEFT,
	RIGHT,
	FlagNull
	
};

extern volatile Direction KeyDirect;
extern volatile uint8_t Flag;
class Key
{

public:
	void Key_Init();


Direction GetDirection()
{
	Direction currentDirection;

	if(Flag == 1)
	{
		currentDirection = KeyDirect; \
		Flag = 0; 
		KeyDirect = FlagNull;  
		return currentDirection;
	}

	return FlagNull; 
}};




#endif
